package interfaces.clients.authorization;

/**
 * The class incapsulates user data.
 *
 * @author Manujlov Maxim
 */
public final class UserData {
  /**
   * user id
   */
  private final int id;

  /**
   * user name
   */
  private final String name;

  /**
   * user password
   */
  private final String pwd;

  /**
   * Constructor
   *
   * @param id user id
   * @param name user name
   * @param pwd user password
   */
  public UserData(int id, String name, String pwd) {
    this.id = id;
    this.name = name;
    this.pwd = pwd;
  }

  /**
   * Constructor
   *
   * @param id user id
   * @param data user authorization data
   */
  public UserData(int id, AuthorizationData data) {
    this.id = id;
    this.name = data.getUsername();
    this.pwd = data.getPassword();
  }

  /**
   * The function returns user id
   *
   * @return user id
   */
  public int getId() {
    return id;
  }

  /**
   * The function returns user name
   *
   * @return user name
   */
  public String getName() {
    return name;
  }

  /**
   * The function returns user password
   *
   * @return user password
   */
  public String getPassword() {
    return pwd;
  }
}
